package com.test.prolenders.bean_prolenders;

import static com.test.prolenders.status_prolenders.PermissionStatus_prolenders.*;

import android.text.TextUtils;

import com.test.prolenders.adapter_prolenders.PermissionViewAdapter_prolenders;
import com.test.prolenders.listener_prolenders.PermissionListener_prolenders;
import com.test.prolenders.status_prolenders.PermissionStatus_prolenders;

public class PermissionInfo_prolenders {

    private PermissionStatus_prolenders status = Default;

    private final Integer iconResId;
    private final String title;
    private final String text;
    private final PermissionListener_prolenders listener;

    private PermissionViewAdapter_prolenders.PermissionDialogHolder holder;

    private final String page;

    public PermissionInfo_prolenders(Integer iconResId, String title, String text, PermissionListener_prolenders listener, String page) {
        this.iconResId = iconResId;
        this.title = title;
        this.text = text;
        this.listener = listener;
        this.page = page;
    }

    public Integer getIconResId() {
        return iconResId;
    }

    public String getTitle() {
        return title;
    }

    public String getText() {
        if (TextUtils.isEmpty(text)) return "";
        return text;
    }

    public PermissionListener_prolenders getListener() {
        return listener;
    }

    public String getPage() {
        if (TextUtils.isEmpty(page)) return "";
        return page;
    }

    public void setStatus(PermissionStatus_prolenders status) {
        this.status = status;
    }

    public PermissionStatus_prolenders getStatus() {
        return status;
    }

    public void setHolder(PermissionViewAdapter_prolenders.PermissionDialogHolder holder) {
        this.holder = holder;
    }

    public void onPermissionAgree(){
        if (listener!=null) listener.onPermissionAgree();
    }

    public void onPermissionDeny(){
        if (listener!=null) listener.onPermissionDeny();
    }

    public void next(){
        if (listener!=null) listener.onNextClick();
    }

}
